<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,user-scalable=no"name="viewport">
<style>
  .file {  
    position: relative;  
    display: inline-block;  
    background: #99D3F5;  
    border: 1px solid #99D3F5;  
    border-radius: 4px;  
    padding: 4px 12px;  
    overflow: hidden;  
    color: #1E88C7;  
    text-decoration: none;  
    text-indent: 0;  
    line-height: 20px;  
}  
.file input {  
    position: absolute;  
    font-size: 100px;  
    right: 0;  
    top: 0;  
    opacity: 0;  
}  
.file:hover {  
    background: #AADFFD;  
    border-color: #78C3F3;  
    color: #004974;  
    text-decoration: none;  
}  
</style>
<title>店主认证</title>
<link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/customer/css/base.css" />
<link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/customer/css/style.css" />
<link rel="stylesheet" href="{:C('WEB_URL')}Public/customer/css/mui.min.css">
<link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/customer/css/bootstrap.min.css" />
<script type="text/javascript" charset="UTF-8" src="{:C('WEB_URL')}Public/customer/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="{:C('WEB_URL')}Public/customer/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/customer/css/mui.picker.min.css" />
<script type="text/javascript" charset="UTF-8" src="{:C('WEB_URL')}Public/customer/js/script.js"></script>

</head>

<div id="box">
 <div class="navbar navbar-default navbar-fixed-top">
  <header>
   <h1><a href="more.html"><span class="glyphicon glyphicon-menu-left"></span></a></h1>
   <p class="title">店主认证</p>
  </header>
 </div><!--navbar-fixed-top-->
 <div class="appHead">
  <p class="headBig">第一步 店主信息<span><a href="#">1</a>/3</span></p>
  <p>为保障您的账户安全，请务必填写店铺法人本人资料</p>
 </div><!--appHead-->
 <div class="appContent">
  <h6></h6>
  <form id='myForm' method="post" enctype="multipart/form-data">
   <div class="approve">
    <label>真实姓名</label>
    <input type="text" name="name" placeholder="请输入您的姓名" />
   </div>
   <div class="approve">
    <label>注册证号</label>
    <input type="number" name="num1" placeholder="请输入注册证号" />
   </div>
   <div class="approve">
    <label>营业执照有效日期</label>
    <a id='demo2' data-options='{"type":"date","beginYear":1920,"endYear":2017}' class="btn mui-btn mui-btn-block" name="date1"><div id='result' class="ui-alert" >营业执照有效日期</div> </a>
   </div>
   <input type='hidden' id='data1' name='data1'>
   <div class="approve">
    <label>营业执照照片</label>
    <div >
    <a href="javascript:;" class="file">选择文件 
     <input type="file" name="file" class="file" id="text1" />
    </a> 
   </div>
   </div>
 
  <div class="approve">
  <div class="cuns" id="cun">保存</div>
  <div style="margin:50px"></div>
  </div>
 </div><!--appContent-->
  </form>
 <div class="navbar navbar-default navbar-fixed-bottom">
   <footer id="foot">
    <dl>
     <dt><a href="{:U('index')}"><img src="{:C('WEB_URL')}Public/customer/images/mores_15.jpg" /></a></dt>
     <dd><a href="{:U('index')}">首页</a></dd>
    </dl>
    <dl>
     <dt><a href="http://www.nleaves.com/qinqin/wechat/user/recommends?uid={$_SESSION[user_id]}"><img src="{:C('WEB_URL')}Public/customer/images/mores_17.jpg" /></a></dt>
     <dd><a href="http://www.nleaves.com/qinqin/wechat/user/recommends?uid={$_SESSION[user_id]}">推荐有奖</a></dd>
    </dl>
    <dl>
     <dt><a href="{:U('more')}"><img src="{:C('WEB_URL')}Public/customer/images/mores_19.jpg" /></a></dt>
     <dd><a href="{:U('more')}" class="current">更多</a></dd>
    </dl>
   </footer>
  </div><!--/navbar-->  
</div><!--box-->
<script type="text/javascript" charset="UTF-8" src="{:C('WEB_URL')}Public/customer/js/mui.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="{:C('WEB_URL')}Public/customer/js/mui.picker.min.js"></script>
<script type="text/javascript">
//微信判断header是否显示
if(isWeiXin()){ 
//alert("====");
$(".title").hide();
} 
else{
//alert("+++++");
}
    //修改生日jQuery
    var myDate = new Date();
        myDate.getYear();        //获取当前年份(2位)
        var fullYear=myDate.getFullYear();    //获取完整的年份(4位,1970-????)
        var data_options='{"type":"date","beginYear":'+fullYear+',"endYear":'+(fullYear+50)+'}';
        $("#demo2").attr("data-options",data_options);
        //console.log("=="+data_options);//输出
        //修改生日jQuery  End
        
      (function($) {
        $.init();
        var result = $('#result')[0];
        var btns = $('.btn');
        btns.each(function(i, btn) {
          btn.addEventListener('tap', function() {
            var optionsJson = this.getAttribute('data-options') || '{}';
            var options = JSON.parse(optionsJson);
            var id = this.getAttribute('id');
            /*
             * 首次显示时实例化组件
             * 示例为了简洁，将 options 放在了按钮的 dom 上
             * 也可以直接通过代码声明 optinos 用于实例化 DtPicker
             */
            var picker = new $.DtPicker(options);
            picker.show(function(rs) {
              /*
               * rs.value 拼合后的 value
               * rs.text 拼合后的 text
               * rs.y 年，可以通过 rs.y.vaue 和 rs.y.text 获取值和文本
               * rs.m 月，用法同年
               * rs.d 日，用法同年
               * rs.h 时，用法同年
               * rs.i 分（minutes 的第二个字母），用法同年
               */
              result.innerText = '' + rs.text;
              /* 
               * 返回 false 可以阻止选择框的关闭
               * return false;
               */
              /*
               * 释放组件资源，释放后将将不能再操作组件
               * 通常情况下，不需要示放组件，new DtPicker(options) 后，可以一直使用。
               * 当前示例，因为内容较多，如不进行资原释放，在某些设备上会较慢。
               * 所以每次用完便立即调用 dispose 进行释放，下次用时再创建新实例。
               */
              picker.dispose();
            });
          }, false);
        });
      })(mui);
      function check_form(form_id) {
              last_submit = $('#' + form_id).data('last_submit');
              current_submit = new Date().getTime();
              if (last_submit == undefined) {
                $('#' + form_id).data('last_submit', new Date().getTime());
              } else {
                if (current_submit - last_submit > 600) {
                  $('#' + form_id).data('last_submit', new Date().getTime());
                } else {
                  return false;
                }
              }
              if ( typeof (tinyMCE) != 'undefined') {
                tinyMCE.triggerSave(true);
              }

              var check_flag = true;
              $("#" + form_id + " :input").each(function(i) {
                if ($(this).attr("check")) {
                  if (!validate($(this).val(), $(this).attr("check"))) {
                    ui_error($(this).attr("msg"));
                    $(this).focus();
                    check_flag = false;
                    return check_flag;
                  }
                }
              });
              return check_flag;
            }


      function sendForm(formId, post_url, return_url) {
            if (check_form(formId)) {
              //绑定beforeunload事件
              $(window).unbind('beforeunload', null);
              if ($("#ajax").val() == 1) {
                var vars = $("#" + formId).serialize();
                $.ajax({
                  type : "POST",
                  url : post_url,
                  data : vars,
                  dataType : "json",
                  success : function(data) {
                    if (data.status) {
                      ui_alert(data.info, function() {
                        if (return_url) {
                          location.href = return_url;
                        }
                      });
                    } else {
                      ui_error(data.info);
                    }
                  }
                });
              } else {
                $("#" + formId).attr("action", post_url);
                if (return_url) {
                  set_cookie('return_url', return_url);
                }
                $("#" + formId).submit();
              }
            }
          }
          $('#cun').click(function(){
          
            $('#data1').val($('#result').html());
            // alert($('#sex p').children('span').attr('style','hover').html());  
            sendForm("myForm","{:U('User/approveSave')}");
          })


          $('#foot dl').on("touchstart",function(){
  // alert(1);
  $('#foot dl').css("background-color","#fff")
  $(this).css("background-color","#ddd")
})
$('#foot dl').on("touchend",function(){
  // alert(1);
  $('#foot dl').css("background-color","#fff")

})
</script>

</body>
</html>
